home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
A-Monthly Disks
/
(c)aaf.d64
/
chain-saw.doc
< prev
next >
Wrap
Text File
|
2007-02-04
|
18KB
|
463 lines
************************ ├╚┴╔╬-╙┴╫ ************************
─ISK ╠OG ╥├╦ 3.0
(├)1986 BY ╥.├. ╦RULISH
╔╬╘╥╧─╒├╘╔╧╬
╘HIS DISK LOG PROGRAM FOR THE ├OMMODORE 64 (WITH 1541
─RIVE) OPERATES AT SPEEDS OVER 500% FASTER THAN ANY OF THE
CURRENTLY POPULAR DISK LOG PROGRAMS TESTED. ╔T COMPLETELY
TRACES ALL BLOCKS OF ALL FILES IN THE DISK DIRECTORY,
INCLUDING RELATIVE FILES, IN LESS TIME THAN IS REQUIRED TO
╓┴╠╔─┴╘┼ THE DISK. ╔T PROVIDES ALL OF THE SAME INFORMATION
SUPPLIED BY OTHER PROGRAMS, PLUS SOME VERY USEFUL ADDITIONAL
DATA AND FEATURES.
├╚┴╔╬-╙┴╫ ACHIEVES ITS SPEED BY HAVING ALL ITERATIVE
PROCESSES IN MACHINE LANGUAGE, AND BY HAVING THE TRACE
FUNCTIONS (THE MOST TIME CONSUMING PART OF THE PROGRAM)
ACCOMPLISHED BY ═╠ CODE DOWNLOADED INTO THE DISK DRIVE.
╘HIS PROGRAM IS NOT FOOLPROOF, BUT DOES INCLUDE TRAPS
FOR SOME OF THE MORE COMMON "TRICKS" UTILIZED IN DOCTORING
DISK DIRECTORIES. ┴S A RESULT ├╚┴╔╬-╙┴╫ WILL COPE WITH MANY
DISKS WHICH OTHER DISK LOG PROGRAMS CANNOT HANDLE.
╥┼╠┼┴╙┼ ├╧╬─╔╘╔╧╬╙
├╚┴╔╬-╙┴╫ IS RELEASED FOR ╞╥┼┼ USE BY INDIVIDUALS IN
NON-COMMERCIAL APPLICATIONS. ┴LL OTHER RIGHTS ARE RESERVED
BY THE AUTHOR. ╨ASS IT ALONG TO ANYONE WHO MIGHT MAKE USE
OF IT, BUT PLEASE INCLUDE THIS DOCUMENTATION. ╔F YOU FIND
THIS PROGRAM USEFUL, PLEASE FORWARD A DONATION OF $7.00
ALONG WITH YOUR COMMENTS AND SUGGESTIONS FOR FUTURE
REVISIONS TO:
╥├╦ ╙OFTWARE
╨╧┬ 457
╚ADLOCK, ╫┴ 98339
┼VEN IF YOU DON'T CONSIDER THE PROGRAM TO BE WORTH
$7.00, YOUR COMMENTS WILL STILL BE WELCOMED.
╨AGE 1 OF 7
├╚┴╔╬-╙┴╫ * ─ISK ╠OG ╥├╦ 3.0 (├)1986 BY ╥.├. ╦RULISH
╧╨┼╥┴╘╔╧╬
╘HE PROGRAM IS MENU DRIVEN AND, WITH THE EXCEPTION OF
THE ═╧╬╔╘╧╥ FUNCTIONS, OPERATION IS QUITE SIMPLE. ╫HAT
LITTLE THERE IS TO LEARN IS BEST DONE BY EXPERIENCE. ╙OME
EXPLANATION AS TO THE INTERPRETATION OF OUTPUT DATA IS,
HOWEVER, IN ORDER. ╘HE ═╧╬╔╘╧╥ OPTIONS ARE NOT ESSENTIAL TO
THE PRIMARY FUNCTIONS OF THE PROGRAM AND DISCUSSION OF THESE
WILL BE PRESENTED IN A LATER SECTION.
╚┼┴─┼╥ ─┴╘┴
╘HE HEADER DATA INCLUDES THE NAME OF THE DISK, THE DISK
╔─ CHARACTERS, THE ─╧╙ IDENTIFICATION, AND THE NUMBER OF
BLOCKS FREE.
┬EHIND THE TWO "COSMETIC" ╔─ CHARACTERS WHICH APPEAR IN
CONVENTIONAL DIRECTORY LISTINGS, THERE ARE TWO ADDITIONAL
CHARACTERS IN PARENTHESIS. ╘HESE REPRESENT THE ╔─ USED WHEN
THE DISK WAS FORMATTED. ┘OU HAVE PROBABLY HEARD THAT YOU
SHOULD AVOID A DUPLICATION IN DISK ╔─'S TO PREVENT THE DISK
DRIVE FROM GETTING CONFUSED AND POSSIBLY OVERWRITING AN
EXISTING FILE. ╒NFORTUNATELY THOSE PROGRAMS WHICH "├HANGE
─ISK ╔─" DON'T ACHIEVE ANYTHING BUT CONFUSION, BECAUSE THEY
CHANGE ONLY THE COSMETIC ╔─, AND THE DRIVE REFERS ONLY TO
THE FORMATTED ╔─. ╘HE PRIMARY PURPOSE OF THE "╚EADER ╧NLY"
OPTION IN THIS PROGRAM IS TO FACILITATE A RAPID CHECK FOR ╔─
CONFLICTS.
╘HE "2┴" WHICH IDENTIFIES THE ─╧╙ VERSION IN
CONVENTIONAL DIRECTORY LISTINGS IS ABOUT AS SIGNIFICANT AS
THE COSMETIC ╔─. ╘HE ─╧╙ CHARACTER APPEARING IN PARENTHESIS
REPRESENTS THE THIRD BYTE IN THE ┬┴═ (╘RACK 18, ╙ECTOR 0).
╒NLESS THIS CHARACTER IS AN "┴" YOU WILL NOT BE ABLE TO
WRITE TO THE DISK.
╘HE NUMBER FOR "┬LOCKS ╞REE" WHICH APPEARS IN THE
HEADER IS BASED ON CURRENT ┬┴═ DATA (NOT ON A FILE TRACE),
AND IS THE SAME AS THAT SHOWN IN A CONVENTIONAL LISTING.
╤UESTION-MARKS APPEARING IN THE HEADER ARE REPLACING
CONTROL CHARACTERS. ╘HIS SUBSTITUTION IS NECESSARY TO
PERMIT THE OUTPUTS TO SCREEN AND PRINTER TO PROCEED IN AN
ORDERLY MANNER.
╨AGE 2 OF 7
├╚┴╔╬-╙┴╫ * ─ISK ╠OG ╥├╦ 3.0 (├)1986 BY ╥.├. ╦RULISH
╞╔╠┼ ─┴╘┴ (╫ITH TRACE)
╔F THE ╘╥┴├┼ OPTION IS EXERCISED, DATA FOR A NORMAL
FILE REPRESENTS:
(A) ╘HE ACTUAL NUMBER OF BLOCKS TRACED (INCLUDING
THE SIDE SECTOR BLOCKS FOR ╥ELATIVE FILES).
(B) ╘HE FILE NAME, WITH ANY CONTROL CHARACTER
REPLACED BY "?" AND A ' SUBSTITUTED FOR ANY " WITHIN THE
NAME. ("╫"├-64 ╫┼─╟┼ BECOMES ╫'├-64 ╫┼─╟┼)
(C) ┴ SPACE OR FILE TYPE MODIFIER IF APPLICABLE
(*=╒NCLOSED, <=╠OCKED, @=╥EPLACEMENT).
(D) ╘HE INITIAL LETTER OF THE FILE TYPE (╨ROGRAM,
╙EQUENTIAL, ╥ELATIVE, ╒SER, OR ─ELETED).
(E) ╘HE STARTING AND ENDING ADDRESS (IN HEX) FOR
╨ROGRAM FILES, OTHERWISE THE NUMBER OF BYTES IN THE FILE.
(╔F THE NUMBER OF BLOCKS IN A FILE EXCEEDS 255 ADD
╔╬╘(┬LOCKS/256)*254 TO OBTAIN THE CORRECT BYTE COUNT.)
(F) ╘HE ╘RACK AND ╙ECTOR (╘/╙) OF THE FIRST FILE
BLOCK.
╞╔╠┼ ╔╥╥┼╟╒╠┴╥╔╘╔┼╙
╘HE SPACE AFTER THE FILE TYPE IS THE "┼╥╥╧╥ ├╧╠╒═╬". ┴
BLANK IN THIS POSITION INDICATES A GOOD FILE. ┴ "┬"
INDICATES A BLOCK COUNT ERROR. ╘HE FILE TRACE WAS ╧╦, BUT
THE NUMBER OF BLOCKS TRACED DOES NOT AGREE WITH THE FILE
BLOCK COUNT SHOWN IN THE DIRECTORY. ┴ "╘" INDICATES A TRACE
ERROR. ┴ TRACE ERROR OCCURS WHEN AN ATTEMPT IS MADE TO
ACCESS AN ILLEGAL TRACK OR SECTOR, OR A BLOCK CONTAINING A
READ ERROR. ╘HE ╘RACK AND ╙ECTOR OF THE LAST GOOD FILE
BLOCK ARE SHOWN FOLLOWING "╘/╙╠". "╬╧╘ ╘╥┴├┼─" INDICATES AN
ERROR IN THE FIRST FILE BLOCK OR THAT IT IS A DIRECTORY
BLOCK (IN TRACK 18).
┘OU MAY HAVE HEARD OF THE "SAVE WITH REPLACE BUG".
╫ITHOUT GETTING INTO DETAILS, IT CAN BE SAID THAT THE
PROBABILITY OF OVERWRITING AN EXISTING FILE WITHOUT CHANGING
THE TRACED BLOCK COUNT IS PRETTY REMOTE. ╘HUS A QUICK RUN
THROUGH ├╚┴╔╬-╙┴╫ IS A GOOD MEANS OF CHECKING ON THE "BUG'S"
ACTIVITY. (╔T'S BETTER, OF COURSE, TO ALWAYS INCLUDE THE
DRIVE NUMBER IN ALL DISK COMMANDS AND AVOID THE PROBLEM.)
╘RACE ERRORS WILL BE DISCUSSED IN THE NEXT SECTION.
┴ BLOCK COUNT OF 768 FOR A FILE INDICATES THAT THE
FORWARD POINTER ON A FILE BLOCK WAS DOCTORED TO FORM THE
FILE INTO A LOOP.
╨AGE 3 OF 7
├╚┴╔╬-╙┴╫ * ─ISK ╠OG ╥├╦ 3.0 (├)1986 BY ╥.├. ╦RULISH
─╔╙╦ ╔╥╥┼╟╒╠┴╥╔╘╔┼╙
╘HE PROGRAM TOTALS THE BLOCKS TRACED AND SUBTRACTS THIS
NUMBER FROM 664. ╔F THIS DOES NOT AGREE WITH THE NUMBER IN
THE HEADER, A NOTATION IS APPENDED SHOWING THE ╓┼╥╔╞╔┼─
┬╠╧├╦╙ ╞╥┼┼, FOLLOWED BY A REPEAT OF THE HEADER NUMBER.
╔N A COMMERCIAL DISK A DIFFERENCE IN THESE NUMBERS MAY
INDICATE THAT THE ┬┴═ WAS DOCTORED TO PROTECT CERTAIN BLOCKS
WHICH ARE NOT OTHERWISE ACCOUNTED FOR BY DIRECTORY ENTRIES.
╔N ANY EVENT, IT IS UNWISE TO ╓┴╠╔─┴╘┼ OR TO WRITE TO A
COMMERCIAL PROGRAM DISK.
╔F YOUR OWN DISK SHOWS NO ERRORS OTHER THAN THE BLOCKS
FREE COUNT, IT SHOULD BE SAFE TO PERFORM A ╓┴╠╔─┴╘┼. ╘HIS
WILL UPDATE THE ┬┴═ AND FREE UP BLOCKS NO LONGER USED. ╘HE
NEW HEADER DATA SHOULD THEN AGREE WITH THE CALCULATED COUNT.
┴ DISK SHOWING A TRACE ERROR PROBABLY WONT ╓┴╠╔─┴╘┼.
┘OU CAN PRESERVE THE FILE UP TO THE ERROR BY CHANGING THE
FIRST TWO BYTES IN THE LAST GOOD BLOCK TO 0,255. ╘HE
ALTERNATIVE IS TO SCRATCH SUCH FILES AND THEN ╓┴╠╔─┴╘┼.
╔NOPERABLE FILES WITH BLOCK COUNT ERRORS MAY BE CLEARED IN
THE SAME MANNER, BUT BE SURE TO ╓┴╠╔─┴╘┼ IMMEDIATELY AFTER
SCRATCHING. ╘HERE ARE TECHNIQUES FOR SALVAGING WHAT REMAINS
OF FILES WITH TRACE AND BLOCK COUNT ERRORS, BUT THEY ARE A
BIT TOO INVOLVED TO GET INTO AT THIS POINT.
╔F YOU GET REPEAT LISTINGS OF SOME OR ALL FILES, THIS
INDICATES THE FORWARD POINTER IN A DIRECTORY BLOCK HAS BEEN
DOCTORED TO FORM A LOOP.
╘HE PRESENCE OF EITHER A FILE LOOP OR A DIRECTORY LOOP
WILL LEAD TO UNUSUALLY LONG RUN TIMES, BUT THE PROGAM SHOULD
EVENTUALLY FINISH. ╔F THE PROGRAM DOES GET HUNG UP FOR SOME
REASON, YOU CAN PULL THE DISK FROM THE DRIVE AND YOU SHOULD
GET AN OUTPUT OF DATA OBTAINED UP TO THAT POINT. ╔N ANY OF
THESE CASES THE ╓┼╥╔╞╔┼─ ┬╠╧├╦╙ ╞╥┼┼ IS, OF COURSE,
MEANINGLESS.
╨AGE 4 OF 7
├╚┴╔╬-╙┴╫ * ─ISK ╠OG ╥├╦ 3.0 (├)1986 BY ╥.├. ╦RULISH
╞╔╠┼ ─┴╘┴ (╫ITHOUT ╘RACE)
├ONSIDERING THE SPEED AT WHICH ├╚┴╔╬-╙┴╫ OPERATES AND
THE VALUE OF THE INFORMATION PROVIDED BY THE TRACE FUNCTION,
THERE IS REALLY VERY LITTLE JUSTIFICATION FOR THE NO-TRACE
OPTION. ╔T WAS INCLUDED, HOWEVER, SO AS TO NOT BE
CONSPICUOUS BY ITS ABSENCE.
╘HE HEADER DATA IN THIS MODE IS THE SAME AS IN THE
TRACE MODE. ╧THER DATA PRESENTED IS SIMILAR TO THE TRACE
MODE EXCEPT AS FOLLOWS:
(A) ╘HE BLOCK COUNT SHOWN IS TAKEN FROM THE
DIRECTORY, BUT WILL NOT REGISTER GREATER THAN 768.
(B) ╘HE ONLY ERROR INDICATOR SHOWN IS AN "┼".
╘HIS IS THE SAME AS A ╬╧╘ ╘╥┴├┼─ ERROR, AND MEANS ANY
PROGRAM STARTING ADDRESS WHICH MAY FOLLOW IS INVALID.
(C) ╘HERE IS NO ENDING ADDRESS OR BYTE COUNT.
╨╥╔╬╘┼╥ ╧╨╘╔╧╬╙
╘HE ╬╧╥═┴╠ PRINT OPTION SHOULD WORK WITH ANY ├OMMODORE
COMPATIBLE PRINTER. ╞ILE DATA IS FORMATTED IN TWO COLUMNS
WITH A FOUR SPACE LEFT MARGIN.
╘HE ╘╔╬┘ PRINT OPTION IS DESIGNED TO WORK WITH ╟┼═╔╬╔,
┼╨╙╧╬, OR ╨┴╬┴╙╧╬╔├ PRINTERS WITH ╪┼╘┼├ OR ├┴╥─├╧
INTERFACES. ╔T USES CONDENSED SUBSCRIPT PRINT TO PRODUCE
JACKET-SIZED DIRECTORIES. ╔N THIS MODE ANY GRAPHIC
CHARACTERS IN FILE NAMES ARE REPLACED BY "#" TO AVOID
UPSETTING COLUMN REGISTRATION (THIS SUBSTITUTION IS
IRREVERSIBLE).
╔F THERE IS SUFFICIENT DEMAND, OTHER PRINTER/INTERFACE
COMBINATIONS WILL BE ACCOMMODATED IN THE NEXT REVISION.
╫HEN EITHER PRINTER OPTION IS FIRST EXERCISED YOU ARE
PRESENTED WITH AN OPPORTUNITY TO ENTER A DATE OR OTHER
NOTATION. ╘HIS WILL APPEAR IN ALL SUBSEQUENT HEADERS. ╔F A
CHANGE IS DESIRED, EXIT AND RE-RUN THE PROGRAM.
╨AGE 5 OF 7
├╚┴╔╬-╙┴╫ * ─ISK ╠OG ╥├╦ 3.0 (├)1986 BY ╥.├. ╦RULISH
═╧╬╔╘╧╥ ╧╨╘╔╧╬╙
┬Y USING A MONITOR PROGRAM YOU CAN GAIN ADDITIONAL
INFORMATION FROM THIS PROGRAM. ┘OU WILL FIND THE ENTIRE
DISK DIRECTORY LAID OUT IN YOUR COMPUTER MEMORY.
╘HE ┬┴═ IS AT $1╞00-1╞╞╞ AND REMAINS UNADULTERATED
THROUGHOUT THE PROGRAM. ╘HE DIRECTORY AND SUPPLEMENTAL DATA
FOR EACH FILE APPEARS STARTING AT $2000+$20*╬. ╞IGURE 1
STARTS WITH A STANDARD DIRECTORY ENTRY FOR AN INDIVIDUAL
FILE, AND SHOWS THE PROCESSING ACCOMPLISHED WITHIN THE DISK
DRIVE AND WITHIN THE COMPUTER.
╘HE INITIAL ═╧╬╔╘╧╥ OPTION PERMITS VIEWING THE FILE
DATA AS IT COMES FROM THE DISK DRIVE. ╘HE MAIN USE FOR THIS
FUNCTION IS TO READ CONTROL CHARACTERS BEFORE THEY GET
CHANGED TO "?".
╘HE SECOND ═╧╬╔╘╧╥ OPTION CAN BE USED TO INVESTIGATE
ANY SCRATCHED FILES WHICH MAY BE INDICATED BY THE DATA
OUTPUT. ┘OU CAN READ THE FILE NAME, AND DETERMINE IF THE
FILE IS RECOVERABLE BY COMPARING THE TRACED BLOCK COUNT TO
THE DIRECTORY COUNT.
┼ITHER MONITOR OPTION PERMITS READING THE UN-EDITED
DISK NAME , COSMETIC ╔─, AND ─╧╙ IN THE ┬┴═. ╘HE FORMATTED
╔─ APPEARS AT $1┼┼┼,╞.
├╚┴╔╬-╙┴╫ IS SET UP TO OPERATE WITH A MONITOR PROGRAM
WHICH IS PRE-LOADED INTO THE $8000 BLOCK AND IS ACTIVATED BY
A ╙┘╙ TO 36275. ┴NY MONITOR PROGRAM WHICH LOADS AT $8000 OR
ABOVE CAN BE USED, AND WILL BE PROTECTED FROM BEING
OVERWRITTEN. ╘O FACILITATE THE USE OF A DIFFERENT MONITOR
PROGRAM YOU CAN ╠╧┴─ AND ╠╔╙╘ ├╚┴╔╬-╙┴╫ (─ON'T ╥╒╬!),
OVERWRITE THE 36275 IN LINE 620 (AND OPTIONALLY THE
ADDRESSES IN LINE 1032) WITH THE CORRECT ADDRESS, AND THEN
╙┴╓┼. ┴ PROGRAM WITH A 32 ┴╙├╔╔ CHARACTER DISPLAY OPTION IS
HIGHLY DESIRABLE AS IT WILL DISPLAY EACH COMPLETE FILE ON A
SINGLE ROW. ┴ SCROLLING FEATURE IS, OF COURSE, ALSO NICE TO
HAVE.
╔F SOMEONE CAN COME UP WITH A GOOD NON-COPYRIGHTED
MONITOR PROGRAM ╔'LL INCORPORATE IT IN THE NEXT REVISION.
╨AGE 6 OF 7
├╚┴╔╬-╙┴╫ * ─ISK ╠OG ╥├╦ 3.0 (├)1986 BY ╥.├. ╦RULISH
╞╔╟╒╥┼ 1
╞╔╠┼ ─┴╘┴ ╨╥╧├┼╙╙╔╬╟
╬╧╥═┴╠ ╔╬-─╔╙╦ ╔╬-├╧═╨╒╘┼╥
─╔╥┼├╘╧╥┘ ╨╥╧├┼╙╙╔╬╟ ╨╥╧├┼╙╙╔╬╟
---------------- ---------------- ----------------
#0 $00 ╞ILE ╘YPE ╬├ ╬├
1 01 ╘ ╞IRST ┬LOCK ╬├ ╬├
2 03 ╙ ╞IRST ┬LOCK ╬├ ╬├
3 04 ╞
4 05 ╔ ╬
-- -- ╠ ┴ ╬├ ┼─╔╘┼─
17 11 ┼ ═
18 12 ┼
29 13 ╔╞ ( ╘ 1ST ╙┬ ┌ERO IF TRACED ╘YPE ═ODIFIER
20 14 ╥┼╠( ╙ 1ST ╙┬ ╬├ ╞ILE ╘YPE ╔NIT
21 15 ╞ ( ╥ECORD ╙IZE ╬├ ┌ERO
22 16 ┌ERO ╙TART ┴DD ╠╧ ╬├
23 17 ┌ERO ╙TART ┴DD ╚╔ ╬├
24 18 ┌ERO ╬/╘/┌ERO (╬OTE 1) ┼ND ┴DD/┬YTES ╠╧
25 19 ┌ERO ╙/┬YTES(╬OTE 1) ┼ND ┴DD/┬YTES ╚╔
26 1┴ ╔╞( ╘ 1ST ╥EP ┬LK ╘RACED ┬LOCKS ╠╧ ╬├
27 1┬ @ ( ╙ 1ST ╥EP ┬LK ╘RACED ┬LOCKS ╚╔ ╬├
28 1├ ┬LOCK COUNT ╠╧ ╬├ ╬├
29 1─ ┬LOCK COUNT ╚╔ ╬├ ╬├
30 1┼ ┌ERO ╬├ ┼RROR ╔DENT
31 1╞ ┌ERO (╬OTE 2) ╬├
------------------------------------------------------
╬OTE 1. ╘HE TRACE FUNCTION INITIALLY STORES AN "╬" IN
$18. ┴S EACH BLOCK IS TRACED THE ╘RACK AND
╙ECTOR ARE STORED IN $18 AND $19. ┴FTER A GOOD
TRACE $18 IS ZERO AND $19 IS THE NUMBER OF
BYTES IN THE LAST BLOCK.
╬OTE 2. ┴ FILE COUNT INDICATOR IS STORED IN $1╞ OF THE
FIRST FILE IN THE LAST DIRECTORY BLOCK. ═EMORY
LOCATIONS FOR THE LAST TWO BYTES IN THE LAST
FILE IN EACH DIRECTORY BLOCK ARE NOT WRITTEN TO
BY THE FILE DATA TRANSFER FROM THE DISK.
╨AGE 7 OF 7